Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODStorageSystem


AcquireContainer

Document Shell

The AcquireContainer method returns a reference to the container object with the specified container type and identifier.

ODContainer AcquireContainer (
                        in ODContainerType containerType, 
                        in ODContainerID id);
containerType
The type of the container object.
id
A container ID whose buffer contains data identifying the container object.
return value
A reference to the specified container object.
DISCUSSION
The document shell and container applications call this method when opening an OpenDoc container.

The container type must be one of the following: the default file container for this platform (kODDefaultFileContainer), the default memory container for this platform (kODDefaultMemoryContainer), the Bento file container (kODBentoFileContainer), or the Bento memory container (kODBentoMemoryContainer).

The structure of the data in the id parameter's buffer depends on the type of container, as specified by the containerType parameter. For example, the identifier for a file container is a specification for a file-system file; the identifier for a memory container is a handle for a relocatable memory block.

When the structure passed as the id parameter is no longer needed, the caller should deallocate that structure and its buffer.

This method increments the reference count of the returned container. When the caller has finished using that container, it should call the container's Release method.

EXCEPTIONS
kODErrCannotCreateContainer
The specified container type is not valid.
SEE ALSO
The ODContainerID type (page 900).
The ODContainerType type (page 901).
The ODStorageSystem::CreateContainer method (page 660).
"Insert" on page 247 in OpenDoc Programmer's Guide.
Table 11-1 on page 466 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help